import request from '@/router/axios';
import {baseUrl} from '@/config/env';

export const getPages = (page, limit, params) => {
  return request({
    url: baseUrl + '/api/log/getpages',
    method: 'get',
    params: {
      key:params.message==undefined?'':params.message,
      type:params.callsite==undefined?'':params.callsite,
      time:params.logged==undefined?'':params.logged[0]+','+params.logged[1],
	  where:params.ip==undefined?'':params.ip,
      page,
      limit,
    }
  })
}
export const remove = (ids) => {
  return request({
    url: baseUrl + '/api/log/remove',
    method: 'post',
    headers:{
      'Content-Type':'application/x-www-form-urlencoded'
    },
    params: {
      ids,
    }
  })
}

export const upload = (fd) => {
  return request({
    url: baseUrl + '/api/files/upload',
    method: 'post',
    data: fd
  })
}
export const delFile = (ids) => {
  return request({
    url: baseUrl + '/api/files/remove',
    method: 'post',
    headers:{
      'Content-Type':'application/x-www-form-urlencoded'
    },
    params: {
      ids,
    }
  })
}
